<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" omit-xml-declaration="yes"/>
    <xsl:template match="/">
        <html>
            <head>
              <link rel="stylesheet" type="text/css" href="css/screen.css" /> 
              <title>Chupacabra :: Department list</title>
            </head>
            <body>
                <div id="header">
                  <ul>
                    <li class="inactive"><a href="/peaa/jobs.htm">Jobs</a></li>
                    <li class="active"><a href="#">Departments</a></li>
                    <li class="inactive"><a href="/peaa/employees.htm">Employees</a></li>
                  </ul>
                </div>
                <div class="clear" />
                <div id="content">
                <h1>Departments</h1>
                <table class="employee_table">
                  <tr>
                	<th>Id</th>
                	<th>Title</th>
                	<th>Manager</th>
                	<th>Location</th>
                	<th>No. of employees</th>
                	<th>Average salary</th>
                  </tr>
                  <xsl:for-each select="departments/department">
                    <tr>
                      <td><xsl:value-of select="id" /></td>
                      <td><xsl:value-of select="name" /></td>
                      <td><xsl:value-of select="manager" /></td>
                      <td><xsl:value-of select="location" /></td>
                      <td align="right"><xsl:value-of select="employees" /></td>
                      <td align="right"><xsl:value-of select="format-number(average, '#.00')" /></td>
                    </tr>
                  </xsl:for-each>
                </table>
                </div>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>